home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / cenvi2.arj / BOXPOS.CMD < prev    next >
OS/2 REXX Batch file  |  1993-11-14  |  1KB  |  44 lines

  1. EXTPROC CEnvi
  2. /***********************************************************
  3.  *** BoxPos.cmd - Set and/or show the default values for ***
  4.  ***              OS/2 and DOS boxes                     ***
  5.  ***********************************************************/
  6.  
  7. #include <Profile.lib>
  8.  
  9. main(argc,argv)
  10. {
  11.    // Get current size
  12.    #define SHAPE_SIZE   18
  13.    #define ROW_OFFSET   6
  14.    #define COL_OFFSET   8
  15.    BLObSize(current,SHAPE_SIZE);
  16.    PrfQueryProfileData(HINI_USERPROFILE,"Shield","sInitialShape",current,SHAPE_SIZE);
  17.    printf("Current Position (row x col) = %d x %d\n",
  18.           BLObGet(current,ROW_OFFSET,SWORD16),BLObGet(current,COL_OFFSET,SWORD16));
  19.  
  20.    if ( argc != 1  &&  argc != 3 )
  21.       Instructions();
  22.    else if ( argc == 3 ) {
  23.       row = atoi(argv[1]), col = atoi(argv[2]);
  24.       BLObPut(current,ROW_OFFSET,row,SWORD16);
  25.       BLObPut(current,COL_OFFSET,col,SWORD16);
  26.       PrfWriteProfileData(HINI_USERPROFILE,"Shield","sInitialShape",current,SHAPE_SIZE);
  27.    }
  28. }
  29.  
  30. Instructions()
  31. {
  32.    printf("\n")
  33.    printf("BoxPos - Show and Set the default position for DOS and OS/2 windows\n")
  34.    printf("\n")
  35.    printf("USAGE: BoxPos [Row Column]\n")
  36.    printf("\n")
  37.    printf("WHERE: Row & Column are the position for lower-left corner\n")
  38.    printf("\n")
  39.    printf("EXAMPLES: BoxPos 0 0      - Set to lowest left corner\n")
  40.    printf("          BoxFont 100 300 - Set to row 100, column 300\n");
  41.    printf("\n")
  42. }
  43.  
  44.